import { Form, Input, Button, Space, DatePicker, Cascader ,Radio } from 'antd'
import styles from './interviewRecord.less'
import Leditor from '@/components/mdEditor'

const interviewRecord: React.FC = () => {
const options = [
    {
      value: '半小时',
      label: '半小时',
    },
    {
      value: '半小时到一小时',
      label: '半小时到一小时',
    },
    {
      value: '一小时以上',
      label: '一小时以上',
    },
  ];
  const { TextArea } = Input;
  const onFinish = (values: any) => {
    console.log('Success:', values);
  };
  const onFinishFailed = (errorInfo: any) => {
    console.log('Failed:', errorInfo);
  };
  function onChangeday(value: any, dateString: any) {
    console.log('Selected Time: ', value);
    console.log('Formatted Selected Time: ', dateString);
  }
  function onOk(value: any) {
    console.log('onOk: ', value);
  }
  function onChange(value: any) {
    console.log(value);
  }
  return <div className={styles.inter}>  
    <h2 className={styles.h2}>添加面试记录</h2>
    <Form className={styles.from}
      initialValues={{ remember: true }}
      onFinish={onFinish}
      onFinishFailed={onFinishFailed}
    >
      <div className={styles.postname}>
        <Form.Item
          name="postname"
          rules={[{message: '请输入岗位名称！' }]}
        >
          <span  className={styles.title}>岗位名称：</span><Input/>
        </Form.Item>
        <Form.Item
          name="password"
          rules={[{ message: '请输入公司名称！' }]}
        >   
          <span className={styles.title}>公司名称：</span><Input />
        </Form.Item>
      </div>
      <div className={styles.top}>
        <Form.Item>
        &nbsp;&nbsp;&nbsp;&nbsp;
        &nbsp;&nbsp;&nbsp;&nbsp;<span className={styles.title}>日期：
        </span><Space direction="vertical" size={12}>
         <DatePicker showTime onChange={onChangeday} onOk={onOk}/>
        </Space>
      </Form.Item>  
        <Form.Item>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <span className={styles.title}>时间：</span>
        <span><Cascader options={options} onChange={onChange} changeOnSelect /></span>
        </Form.Item>
        </div>
      <div className={styles.postname}>
      <Form.Item
        name="location"
        rules={[{ message: '请输入面试地点' }]}>
       <span className={styles.title}>面试地点：</span><Input />
      </Form.Item>
      &nbsp;&nbsp;&nbsp;&nbsp;
      <Form.Item
        name="interviewer"
        rules={[{ message: '例如：HR、技术组长' }]}>
       <span className={styles.title}>面试官：</span> <Input />
      </Form.Item>
      </div>
      <div className={styles.editor}>
        <span className={styles.title}>记录-吐槽：</span>
      <Leditor></Leditor>
      </div>
      <Form.Item className={styles.end}>
      <span  className={styles.title}>面试结果：</span><Radio.Group>
      <Radio value={1}>不确定</Radio>
      <Radio value={2}>通过</Radio>
      <Radio value={3}>未通过</Radio>
    </Radio.Group>
      </Form.Item>
      <Form.Item>
       <span className={styles.title}>录音文件：</span><Radio.Group>
      <Radio value={1}>有</Radio>
      <Radio value={2}>无</Radio>
    </Radio.Group>
      </Form.Item>
      <Form.Item>
        <span className={styles.title}>面试问题</span>：请如实填写面试问题和答案，面试中没有作答的题目可略过答案填写，直接输入问题即可。
      </Form.Item>
      <Form.Item>
      <div className={styles.list}>
      <span className={styles.question}>问</span>：
       <Input />
      </div>
      </Form.Item>
      <Form.Item>
        <div className={styles.list}>
           <span className={styles.da}>答</span>：
       <TextArea rows={4} />
        </div>
      </Form.Item>
      <Form.Item>
      <Button className={styles.button} onClick={()=>{history.go(-1)}}>
        返回
        </Button>
        <Button type="primary" htmlType="submit">
          提交
        </Button>
      </Form.Item>
    </Form>
  </div>
}
export default interviewRecord